
<script type="text/html" data-template-name="yaml">
    <div class="form-row">
        <label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="common.label.property"></span></label>
        <input type="text" id="node-input-property" style="width:70%;"/>
    </div>
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
        <input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
    </div>
</script>

<script type="text/javascript">
    RED.nodes.registerType('yaml',{
        category: 'parser',
        color:"#DEBD5C",
        defaults: {
            property: {value:"payload",required:true,
                       validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true }),
                       label:RED._("node-red:common.label.property")},
            name: {value:""}
        },
        inputs:1,
        outputs:1,
        icon: "parser-yaml.svg",
        label: function() {
            return this.name||"yaml";
        },
        labelStyle: function() {
            return this.name?"node_label_italic":"";
        },
        oneditprepare: function() {
            if (this.property === undefined) {
                $("#node-input-property").val("payload");
            }
            $("#node-input-property").typedInput({default:'msg',types:['msg']});
        }
    });
</script>
